class Solution:
	# @param {string} s
	# @param {string} t
	# @return {boolean}
	def isIsomorphic(self, s, t):
		if len(s) != len(t):
			return False
		maap = dict()
		right = set()
		for cs, ct in zip(s,t):
			if cs in maap:
				if ct != maap[cs]:
					return False
			else:
				if ct in right:
					return False
				right.add(ct)
				maap[cs] = ct
		return True

if __name__ == '__main__':
	print Solution().isIsomorphic("ab", "ca")